<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class client_test extends CI_Controller {

	function __construct()
	{
		parent::__construct(); 
		parse_str($_SERVER['QUERY_STRING'], $_GET); 
	}	



	function chklogin()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["username"] = '999999';
		$formvars["password"] = '999999';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '2ab0265b8daa0e926c5f39b6efb78a21';
		
		$formvars["needinfo"] = '1';
		$formvars["debug"] = '0';
		
		//$url = 'http://localhost/zhanyou';
		$url = 'http://z.no4e.com';
		$action = $url.'/index.php/api/client/chklogin';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		echo '<pre>';print_r(json_decode($result));
		
		//echo '<pre>';var_dump(json_decode($result));	
	}
	function reg()
	{	
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["username"] = 'qqqqqq';
		$formvars["password"] = 'qqqqqq';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '2ab0265b8daa0e926c5f39b6efb78a21';
		$formvars["key"] = 'z51c-c3dd-57c2-8177';
		$formvars["debug"] = '1';
	
		//$action = 'http://localhost/zhanyou/index.php/api/client/reg';//表单提交地址
		$action = 'http://z.no4e.com/index.php/api/client/reg';//表单提交地址
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		echo '<pre>';print_r(json_decode($result));
		
		//echo '<pre>';var_dump(json_decode($result));	
	}	
	
	function last_news_creat()
	{
		$array = array(
			'version'=>'1',
			'info'=>array(
				'0'=>array(
					'type_id'=>'1',
					'news_summary'=>'展会欢迎辞',
					'news_state'=>'1',
				),
				'1'=>array(
					'type_id'=>'2',
					'news_summary'=>'参展申请',
					'news_state'=>'0',
				),
				'2'=>array(
					'type_id'=>'3',
					'news_summary'=>'参观流程',
					'news_state'=>'0',
				),
				'3'=>array(
					'type_id'=>'4',
					'news_summary'=>'交通服务',
					'news_state'=>'0',
				),
				'4'=>array(
					'type_id'=>'5',
					'news_summary'=>'行业信息',
					'news_state'=>'0',
				)
			)
		);	
		$json = json_encode($array);
		file_put_contents('static/last_news_1.json',$json);
	}
	function last_news()
	{
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["lan"] = '1';
		$formvars["debug"] = '0';
		
		$url = 'http://localhost/zhanyou';
		//$url = 'http://c.no4e.com';
		$action = $url.'/index.php/api/client/last_news';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		//print_r(($result));	
		//echo '<pre>';print_r(json_decode($result));	
		echo '<pre>';var_dump(json_decode($result));	
	}
	
	function news_list_creat()
	{
		//通知与公告
		$array1 = array(
			'version'=>'1',
			'type_id'=>'1',
			'info'=>array(
				'0'=>array(
					'news_id'=>'3',
					'news_title'=>'紧急通知',
					'news_time'=>'2013-06-27 15:30',
					'news_content'=>'http://z.no4e.com/static/news/1.15.html',
					'news_accessory_tip'=>'',
					'news_accessory'=>'',				
					
				),
				'1'=>array(
					'news_id'=>'2',
					'news_title'=>'前言',
					'news_time'=>'2013-06-27 15:30',
					'news_content'=>'http://z.no4e.com/static/news/1.qianyan.html',
					'news_accessory_tip'=>'',
					'news_accessory'=>'',
				),
				'2'=>array(
					'news_id'=>'1',
					'news_title'=>'展会欢迎辞',
					'news_time'=>'2013-06-27 15:30',
					'news_content'=>'http://z.no4e.com/static/news/1.zhanhuihuanyinci.html',
					'news_accessory_tip'=>'',
					'news_accessory'=>'',
				),
				'3'=>array(
					'news_id'=>'3',
					'news_title'=>'广州建博会举行权益友好转让签约仪式暨新闻发布会',
					'news_time'=>'2013-06-27 15:30',
					'news_content'=>'http://z.no4e.com/static/news/1.3.html',
					'news_accessory_tip'=>'',
					'news_accessory'=>'',		
				),
			)
		);	
		$json1 = json_encode($array1);
		file_put_contents('static/news_list_1_1.json',$json1);
		
die();
//
//
//
//
		//我要参展
		$array2 = array(
			'version'=>'1',
			'type_id'=>'2',
			'info'=>array(
				'0'=>array(
					'news_id'=>'11',
					'news_title'=>'参观流程',
					'news_time'=>'2013-06-27 15:30',
					'news_content'=>'http://z.no4e.com/static/news/2.canguanliucheng.html',
					'news_accessory_tip'=>'',
					'news_accessory'=>'',
				),
				'1'=>array(
					'news_id'=>'12',
					'news_title'=>'参展申请',
					'news_time'=>'2013-06-27 15:30',
					'news_content'=>'http://z.no4e.com/static/news/2.canzhanshenqing.html',
					'news_accessory_tip'=>'',
					'news_accessory'=>'',
				),
				'2'=>array(
					'news_id'=>'13',
					'news_title'=>'特别提示',
					'news_time'=>'2013-06-27 15:30',
					'news_content'=>'http://z.no4e.com/static/news/2.tebietishi.html',
					'news_accessory_tip'=>'',
					'news_accessory'=>'',
				),
				'3'=>array(
					'news_id'=>'14',
					'news_title'=>'现场噪音管理规定',
					'news_time'=>'2013-06-27 15:30',
					'news_content'=>'http://z.no4e.com/static/news/2.xianchangzaoyin.html',
					'news_accessory_tip'=>'',
					'news_accessory'=>'',
				),
				'4'=>array(
					'news_id'=>'15',
					'news_title'=>'搭建及资料派发管理规定',
					'news_time'=>'2013-06-27 15:30',
					'news_content'=>'http://z.no4e.com/static/news/2.dajianjiziliaopafa.html',
					'news_accessory_tip'=>'',
					'news_accessory'=>'',
				),
                                '5'=>array(
					'news_id'=>'16',
					'news_title'=>'倡导“绿色展会”通知',
					'news_time'=>'2013-06-27 15:30',
					'news_content'=>'http://z.no4e.com/static/news/2.lvsezhanhui.html',
					'news_accessory_tip'=>'',
					'news_accessory'=>'',
				),
			)
		);	
		$json2 = json_encode($array2);
		file_put_contents('static/news_list_2_1.json',$json2);	
//
//
//
//
//
//
//
//
//
//		//我要参观
//		$array3 = array(
//			'version'=>'1',
//			'type_id'=>'3',
//			'info'=>array(
//				'0'=>array(
//					'news_id'=>'21',
//					'news_title'=>'展会介绍',
//					'news_time'=>'2013-06-27 15:30',
//					'news_content'=>'http://z.no4e.com/static/news/3.zhanhuijieshao.html',
//					'news_accessory_tip'=>'',
//					'news_accessory'=>'',
//				),
//				'1'=>array(
//					'news_id'=>'22',
//					'news_title'=>'展会概况',
//					'news_time'=>'2013-06-27 15:30',
//					'news_content'=>'http://z.no4e.com/static/news/3.zhanhuigaikuang.html',
//					'news_accessory_tip'=>'',
//					'news_accessory'=>'',
//				),
//				'2'=>array(
//					'news_id'=>'23',
//					'news_title'=>'展馆简介',
//					'news_time'=>'2013-06-27 15:30',
//					'news_content'=>'http://z.no4e.com/static/news/3.zhanguanjianjie.html',
//					'news_accessory_tip'=>'',
//					'news_accessory'=>'',
//				),
//				'3'=>array(
//					'news_id'=>'24',
//					'news_title'=>'参观流程',
//					'news_time'=>'2013-06-27 15:30',
//					'news_content'=>'http://z.no4e.com/static/news/3.canguanliucheng.html',
//					'news_accessory_tip'=>'',
//					'news_accessory'=>'',
//				),
//				'4'=>array(
//					'news_id'=>'25',
//					'news_title'=>'知名参展品牌',
//					'news_time'=>'2013-06-27 15:30',
//					'news_content'=>'http://z.no4e.com/static/news/3.zhimingcanzhanpinpai.html',
//					'news_accessory_tip'=>'',
//					'news_accessory'=>'',
//				),
//			)
//		);	
//		$json3 = json_encode($array3);
//		file_put_contents('static/news_list_3_1.json',$json3);
//
//
//
//
//
//
//
//                //服务宝典
//		$array4 = array(
//			'version'=>'1',
//			'type_id'=>'4',
//			'info'=>array(
//				'0'=>array(
//					'news_id'=>'31',
//					'news_title'=>'广州概况',
//					'news_time'=>'2013-06-27 15:30',
//					'news_content'=>'http://z.no4e.com/static/news/4.guangzhougaikuang.html',
//					'news_accessory_tip'=>'',
//					'news_accessory'=>'',
//				),
//				'1'=>array(
//					'news_id'=>'32',
//					'news_title'=>'合作酒店',
//					'news_time'=>'2013-06-27 15:30',
//					'news_content'=>'http://z.no4e.com/static/news/4.hezuojiudian.html',
//					'news_accessory_tip'=>'',
//					'news_accessory'=>'',
//				),
//				'2'=>array(
//					'news_id'=>'33',
//					'news_title'=>'交通服务',
//					'news_time'=>'2013-06-27 15:30',
//					'news_content'=>'http://z.no4e.com/static/news/4.jiaotongfuwu.html',
//					'news_accessory_tip'=>'',
//					'news_accessory'=>'',
//				),
//				'3'=>array(
//					'news_id'=>'34',
//					'news_title'=>'商旅须知',
//					'news_time'=>'2013-06-27 15:30',
//					'news_content'=>'http://z.no4e.com/static/news/4.shanglvxuzhi.html',
//					'news_accessory_tip'=>'',
//					'news_accessory'=>'',
//				),
//			)
//		);	
//		$json4 = json_encode($array4);
//		file_put_contents('static/news_list_4_1.json',$json4);







 //               //行业信息
//		$array5 = array(
//			'version'=>'1',
//			'type_id'=>'5',
//			'info'=>array(
//				'0'=>array(
//					'news_id'=>'41',
//					'news_title'=>'建博会开幕，智慧展览受热捧',
//					'news_time'=>'2013-06-27 15:30',
//					'news_content'=>'http://z.no4e.com/static/news/5.3.html',
//					'news_accessory_tip'=>'',
//					'news_accessory'=>'',
//				),
//				'1'=>array(
//					'news_id'=>'48',
//					'news_title'=>'建博会开幕，首推实时社交平台',
//					'news_time'=>'2013-06-27 15:30',
//					'news_content'=>'http://z.no4e.com/static/news/0710.5.4.html',
//					'news_accessory_tip'=>'',
//					'news_accessory'=>'',
//				),
//				'2'=>array(
//					'news_id'=>'43',
//					'news_title'=>'红木家具销量上扬三成 中档产品倍受青睐',
//					'news_time'=>'2013-06-27 15:30',
//					'news_content'=>'http://z.no4e.com/static/news/5.hongmujiaju.html',
//					'news_accessory_tip'=>'',
//					'news_accessory'=>'',
//				),
//				'3'=>array(
//					'news_id'=>'44',
//					'news_title'=>'2013陶瓷产业市场五大发展趋势',
//					'news_time'=>'2013-06-27 15:30',
//					'news_content'=>'http://z.no4e.com/static/news/5.2013taocichanye.html',
//					'news_accessory_tip'=>'',
//					'news_accessory'=>'',
//				),
//                                '4'=>array(
//					'news_id'=>'45',
//					'news_title'=>'我国五金模具行业市场当前发展进程加快',
//					'news_time'=>'2013-06-27 15:30',
//					'news_content'=>'http://z.no4e.com/static/news/5.wujinmoju.html',
//					'news_accessory_tip'=>'',
//					'news_accessory'=>'',
//				),
//				'5'=>array(
//					'news_id'=>'46',
//					'news_title'=>'2013年中国LED照明市场现状与策略分析',
//					'news_time'=>'2013-06-27 15:30',
//					'news_content'=>'http://z.no4e.com/static/news/5.zhongguoLED.html',
//					'news_accessory_tip'=>'',
//					'news_accessory'=>'',
//				),
//				'6'=>array(
//					'news_id'=>'47',
//					'news_title'=>'整体橱柜十大品牌：品牌化时代的战略内涵',
//					'news_time'=>'2013-06-27 15:30',
//					'news_content'=>'http://z.no4e.com/static/news/5.zhengtichugui.html',
//					'news_accessory_tip'=>'',
//					'news_accessory'=>'',
//				),
//				'6'=>array(
//					'news_id'=>'42',
//					'news_title'=>'定制衣柜与现场打制衣柜的比较',
//					'news_time'=>'2013-06-27 15:30',
//					'news_content'=>'http://z.no4e.com/static/news/5.dingzhiyigui.html',
//					'news_accessory_tip'=>'',
//					'news_accessory'=>'',
//				),				
//
//			)
//		);	
//		$json5 = json_encode($array5);
//		file_put_contents('static/news_list_5_1.json',$json5);
	}
	
	function news_list()
	{
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["lan"] = '1';
		$formvars["type_id"] = '1';
		$formvars["debug"] = '0';
		
		$url = 'http://localhost/zhanyou';
		//$url = 'http://c.no4e.com';
		$action = $url.'/index.php/api/client/news_list';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		//print_r($result);	
		echo '<pre>';print_r(json_decode($result));	
		//echo '<pre>';var_dump(json_decode($result));	
	}
	
	
	function good_freind_ids()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["member_id"] = '37';
		$formvars["token"] = '3f29def8b792b02fd99a600647da035a';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '1234567890';
		
		$formvars["debug"] = '0';
		
		
		//$url = 'http://localhost/zhanyou';
		$url = 'http://z.no4e.com';
		$action = $url.'/index.php/api/client/good_freind_ids';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;
		echo '<hr>';
		echo '<pre>';var_dump(json_decode($result));
		//echo '<pre>';print_r(json_decode($result));	
	}		
	
	
	function update_friend()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["member_id"] = '4';
		$formvars["friend_id"] = '5';
		$formvars["operate"] = '1';
		$formvars["request_type"] = '1';
		
		$formvars["token"] = 'JPa8sK0hdeIFKODwiPoMo6RMoRIkk';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '1234567890';
		
		$formvars["debug"] = '1';
		
		
		$url = 'http://localhost/zhanyou';
		//$url = 'http://c.no4e.com';
		$action = $url.'/index.php/api/client/update_friend';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;die();
		echo '<pre>';var_dump(json_decode($result));
		//echo '<pre>';print_r(json_decode($result));	
	}	
	
	
	function product_collect()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["member_id"] = '6';
		$formvars["product_id"] = '55';
		$formvars["operate"] = '1';
		
		$formvars["token"] = '7eed3f228bca206f5243a185661d7525';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '315c1972e91caba34f70f203fec9a6d9';
		
		$formvars["debug"] = '1';
		
		
		$url = 'http://localhost/zhanyou';
		//$url = 'http://z.no4e.com';
		$action = $url.'/index.php/api/client/product_collect';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		//echo $result;die();
		echo '<pre>';var_dump(json_decode($result));
		//echo '<pre>';print_r(json_decode($result));	
	}	
	
	
	
	function get_collect_products()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["member_id"] = '10';
		$formvars["page"] = '0';
		$formvars["count_per_page"] = '50';
		$formvars["search"] = '';
		
		$formvars["token"] = 'JPa8sK0hdeIFKODwiPoMo6RMoRIkk';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '1234567890';
		
		$formvars["debug"] = '0';
		
		
		$url = 'http://localhost/zhanyou';
		//$url = 'http://z.no4e.com';
		$action = $url.'/index.php/api/client/get_collect_products';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		//echo $result;die();
		//echo '<pre>';var_dump(json_decode($result));
		echo '<pre>';print_r(json_decode($result));	
	}	
	
	function comment_product()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["member_id"] = '8';
		$formvars["product_id"] = '1';
		$formvars["comment"] = '阿萨德撒的撒的撒d';
		
		$formvars["token"] = 'JPa8sK0hdeIFKODwiPoMo6RMoRIkk';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '1234567890';
		
		$formvars["debug"] = '1';
		
		
		$url = 'http://localhost/zhanyou';
		//$url = 'http://c.no4e.com';
		$action = $url.'/index.php/api/client/comment_product';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		//echo $result;die();
		echo '<pre>';var_dump(json_decode($result));
		//echo '<pre>';print_r(json_decode($result));	
	}	
	
	
	function get_product_comments()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["product_id"] = '45';
		$formvars["page"] = '1';
		$formvars["count_per_page"] = '20';
		
		$formvars["token"] = 'JPa8sK0hdeIFKODwiPoMo6RMoRIkk';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '1234567890';
		
		$formvars["debug"] = '1';
		
		
		$url = 'http://localhost/zhanyou';
		//$url = 'http://c.no4e.com';
		$action = $url.'/index.php/api/client/get_product_comments';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;die();
		//echo '<pre>';var_dump(json_decode($result));
		//echo '<pre>';print_r(json_decode($result));	
	}		
	
	
	
	function get_product()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["product_id"] = '45';
		
		$formvars["token"] = 'JPa8sK0hdeIFKODwiPoMo6RMoRIkk';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '1234567890';
		
		$formvars["debug"] = '1';
		
		
		$url = 'http://localhost/zhanyou';
		//$url = 'http://c.no4e.com';
		$action = $url.'/index.php/api/client/get_product';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		//echo $result;die();
		//echo '<pre>';var_dump(json_decode($result));
		echo '<pre>';print_r(json_decode($result));	
	}		
	
	
	function merchant_product_list()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["member_id"] = '3';
		$formvars["page"] = '0';
		$formvars["count_per_page"] = '0';
		$formvars["product_type_id"] = '0';
		$formvars["account_id"] = '3';
		
		$formvars["token"] = '4ce6b801c531dd1be28bbb5f2263f266';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '1234567890';
		
		$formvars["debug"] = '0';
		
		
		$url = 'http://localhost/zhanyou';
		//$url = 'http://z.no4e.com';
		$action = $url.'/index.php/api/client/merchant_product_list';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		//echo $result;die();
		//echo '<pre>';var_dump(json_decode($result));
		echo '<pre>';print_r(json_decode($result));	
	}		
	
	function get_merchant_contact()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["member_id"] = '1';
	
		$formvars["token"] = 'JPa8sK0hdeIFKODwiPoMo6RMoRIkk';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '1234567890';
		
		$formvars["debug"] = '0';
		
		
		$url = 'http://localhost/zhanyou';
		//$url = 'http://z.no4e.com';
		$action = $url.'/index.php/api/client/get_merchant_contact';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;
		echo '<hr>';
		//echo '<pre>';var_dump(json_decode($result));
		echo '<pre>';print_r(json_decode($result));	
	}		
	
	
	function get_my()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["member_id"] = '2';
	
		$formvars["token"] = '4257e44774efa49410e906bf461be105';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '5efd91ba1d60a31f2eed45ed91c13f73';
		
		$formvars["debug"] = '0';
		
		//$url = 'http://localhost/zhanyou';
		$url = 'http://z.no4e.com';
		$action = $url.'/index.php/api/client/get_my';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;
		echo '<hr>';
		//echo '<pre>';var_dump(json_decode($result));
		echo '<pre>';print_r(json_decode($result));	
	}		
	
	function member_list()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["who"] = '1';
	
		$formvars["token"] = '3a5045388481d39fc39b9e3b70e61dcb';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = 'ac:f7:f3:42:52:48';
		$formvars["page"] = '0';
		$formvars["count_per_page"] = '50';
		$formvars["account_id"] = '0';
		$formvars["friend_only"] = '0';
		$formvars["debug"] = '0';
		
		//$url = 'http://localhost/zhanyou';
		$url = 'http://z.no4e.com';
		$action = $url.'/index.php/api/client/member_list';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;
		echo '<hr>';
		//echo '<pre>';var_dump(json_decode($result));
		echo '<pre>';print_r(json_decode($result));	
	}		
	
	
	function product_list()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["product_type_id"] = '0';
		$formvars["account_id"] = '235';
		
		$formvars["token"] = '33c5cf3932d9d59a7d4ff11dabc73f6f';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = 'e8:99:c4:9a:12:f3';
		//$formvars["tag"] = 'ad';
		$formvars["page"] = '0';
		
		$formvars["debug"] = '0';
		
		//$url = 'http://localhost/zhanyou';
		$url = 'http://z.no4e.com';
		$action = $url.'/index.php/api/client/product_list';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;
		//echo '<pre>';var_dump(json_decode($result));
		echo '<pre>';print_r(json_decode($result));	
	}		
	
	
	function get_message_list()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["member_id"] = '10';
	
		$formvars["token"] = 'JPa8sK0hdeIFKODwiPoMo6RMoRIkk';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '1234567890';
		
		$formvars["debug"] = '1';
		
		$url = 'http://localhost/zhanyou';
		//$url = 'http://z.no4e.com';
		$action = $url.'/index.php/api/client/get_message_list';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;die();
		//echo '<pre>';var_dump(json_decode($result));
		echo '<pre>';print_r(json_decode($result));	
	}		
	
	
	
	
	
	function get_company_info()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["companyuser"] = 'test';
		$formvars["token"] = 'w26pFmeTXFeWMtNNJl2sQw87Qwrsb23Yj';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '5555555555';
		$formvars["lan"] = '1';
		$formvars["debug"] = '0';
		
		$url = 'http://localhost/zhanyou';
		//$url = 'http://c.no4e.com';
		$action = $url.'/index.php/api/client/get_company_info';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;die();
		echo '<pre>';var_dump(json_decode($result));
		//echo '<pre>';print_r(json_decode($result));	
	}		
	
	function get_company_pro_list()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["companyuser"] = 'test';
		$formvars["token"] = 'qs1ixjmPM8lVFn8EBq0nYeVpZsUEbuRSV';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '1234567890';
		$formvars["lan"] = '1';
		$formvars["debug"] = '0';
		
		$url = 'http://localhost/zhanyou';
		//$url = 'http://c.no4e.com';
		$action = $url.'/index.php/api/client/get_company_pro_list';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		//echo $result;die();
		//echo '<pre>';var_dump(json_decode($result));
		echo '<pre>';print_r(json_decode($result));	
	}	
	
	function testpost()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["res1"] = 'test';
		$formvars["res2"] = 'qewqewqe';

		
		$url = 'http://localhost/zhanyou';
		//$url = 'http://c.no4e.com';
		$action = $url.'/index.php/api/client/testpost';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;die();
		//echo '<pre>';var_dump(json_decode($result));
		//echo '<pre>';print_r(json_decode($result));	
	}		
	
	
	function account_tag()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["member_id"] = '3';
		$formvars["tags"] = json_encode(array('木材','家具','红木'));
		$formvars["token"] = '9bc233dca9f04324fe5a6be02e5485f2';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '2ab0265b8daa0e926c5f39b6efb78a21';
		$formvars["debug"] = '1';
		$url = 'http://localhost/zhanyou';
		//$url = 'http://z.no4e.com';
		$action = $url.'/index.php/api/client/account_tag';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;die();
		//echo '<pre>';var_dump(json_decode($result));
		//echo '<pre>';print_r(json_decode($result));	
	}	
	
	function tag_creat()
	{
		$array = array(
		'version'=>'1',
		'status'=>'1',
		'tags'=>array(
		'0'=>array(
			'title'=>'厨房设备及配件',
			'info'=>array(
					'整体橱柜',
					'橱柜配件',
					'水槽',
					'厨房电器',
					'台面材料',
					'板材_面材'
				)
			),
		'1'=>array(
			'title'=>'衣柜及辅料',
			'info'=>array(
					'衣柜',
					'衣柜门',
					'衣帽间',
					'厨房电器',
					'材料及生产设备',
					'衣柜五金配件'
				)
			),
		'2'=>array(
			'title'=>'门窗及辅料',
			'info'=>array(
					'纯木门窗',
					'复合门',
					'铝合金门窗',
					'铝木门',
					'钢门窗',
					'铜门',
					'自动门',
					'防蚊纱窗',
					'铝型材',
					'铝木型材',
					'复合型材',
					'密封件',
					'门窗设备',
					'钢木门',
					'生态门',
					'隔断门窗',
					'百叶门窗',
					'门板',
					'防盗门',
					'玻璃门',
					'卷帘门',
					'折叠门',
					'塑钢门窗',
					'复合窗',
					'门业辅助材料',			
				)
			),
			'3'=>array(
				'title'=>'地面辅装材料',
				'info'=>array(
						'木地板',
						'竹地板',
						'地板配件',
						'地板材料',
						'地毯'		
					)
				),
			'4'=>array(
				'title'=>'卫浴及建筑陶瓷',
				'info'=>array(
						'建筑卫生陶瓷',
						'整体卫浴',
						'浴室五金/配件类',
						'原辅材料及生产设备',
						'各类墙地砖',
						'泳池设备及配件',
						'水处理设备'
					)
			),
			'5'=>array(
				'title'=>'遮阳设备',
				'info'=>array(
						'卷闸门窗及其他配件',
						'遮阳蓬',
						'伞类',
						'软百叶帘',
						'遮阳帘',
						'窗户类',
						'综合类',
						'户外',
						'智能家居系统'
					)
			),
			'6'=>array(
				'title'=>'建筑装饰五金',
				'info'=>array(
						'建筑五金',
						'装饰五金',
						'五金配件',
						'门控五金系统及配件',
						'五金铸造',
						'五金工具',
						'五金磨具',
						'门禁电子系统'
					)
			),			
			'7'=>array(
				'title'=>'装饰玻璃_移门',
				'info'=>array(
						'艺术玻璃',                
						'装饰玻璃',                
						'玻璃门窗',                
						'玻璃机械',                
						'建筑玻璃',                
						'玻璃化工原料及辅料',
						'玻璃深加工机械设备',
						'日用玻璃',               
						'工业玻璃'           
					)
			),	
			'8'=>array(
				'title'=>'天花吊顶/建筑装饰照明',
				'info'=>array(
						'集成吊顶',      
						'金属吊顶',      
						'吊顶加工机械',
						'幕墙',
						'软膜天花',      
						'铝板',            
						'整体家居照明',
						'商业照明',      
						'石膏制品',      
						'专业灯光'	            
					)
			),				
			'9'=>array(
				'title'=>'墙纸/布艺及辅料',
				'info'=>array(
						'各类壁纸壁布',
						'墙纸生产及辅料',
						'高档装饰皮革',   
						'软包',                
						'家纺布艺',        
						'饰品'		       	            
					)
			),
			'10'=>array(
				'title'=>'楼梯',
				'info'=>array(
						'木楼梯',
						'钢楼梯',
						'其他楼梯及相关配件'       	            
					)
			),
			'11'=>array(
				'title'=>'建筑涂料及化学建筑',
				'info'=>array(
						'墙面/防水/地坪涂料',
						'涂料包装材料',
						'干粉砂浆' ,
						'粘合剂',
						'涂刷用具'      	            
					)
			),
			'12'=>array(
				'title'=>'石材',
				'info'=>array(
						'花岗岩',               
						'大理石',               
						'板岩',                  
						'砂岩',                  
						'园艺文化石',       
						'异型石材',            
						'石雕及石制品',     
						'陵园石材',            
						'石英石',               
						'卵石',                  
						'人造石',               
						'石材生产设备',     
						'地面石材'         
					)
			),						
		)
		);	
		//echo '<pre>';print_r($array);die();
		$json = json_encode($array);
		echo file_put_contents('static/tags.json',$json);
	}



	function get_tags()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["debug"] = '1';
		$url = 'http://localhost/zhanyou';
		//$url = 'http://z.no4e.com';
		$action = $url.'/index.php/api/client/get_tags';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;
		//echo '<pre>';var_dump(json_decode($result));
		echo '<pre>';print_r(json_decode($result));	
	}	

	
	function descry()
	{
		echo decrypt('DHE7vUvlqFCAFd52qEhzzICXuI5cu');	
	}


	function upload_headpic()
	{
		if(isset($_FILES['pic'])){
			$this->load->library('Snoopy');
			$snoopy = new Snoopy();
			$snoopy->_submit_type = "multipart/form-data"; //设定submit类型
				
			$formvars["member_id"] = '1';
			$formvars["product_id"] = '45';
 			//$formvars["pic"] = $_FILES;
			$postfiles["pic"] = $_FILES;
			$formvars["token"] = 'JPa8sK0hdeIFKODwiPoMo6RMoRIkk';
			$formvars["client_key"] = '8kkll1Vx';
			$formvars["device_id"] = '1234567890';
		
			$formvars["debug"] = '1';
		
		
			$url = 'http://localhost/zhanyou';
			//$url = 'http://c.no4e.com';
			$action = $url.'/index.php/api/client/upload_headpic';//表单提交地址
			$snoopy->submit($action,$formvars,$postfiles);//$formvars为提交的数组
			
			$result = $snoopy->results;  //获取表单提交后的 返回的结果
			print_r(json_decode($result));die();
		}
		$this->load->view('api/upload_product_pic');
	}
	
	
	
	function collect_company_products()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["member_id"] = '2';
		$formvars["company_id"] = '3';
		
		$formvars["token"] = '9bc233dca9f04324fe5a6be02e5485f2';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '2ab0265b8daa0e926c5f39b6efb78a21';
		$formvars["debug"] = '1';
		$url = 'http://localhost/zhanyou';
		//$url = 'http://z.no4e.com';
		$action = $url.'/index.php/api/client/collect_company_products';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;die();
		//echo '<pre>';var_dump(json_decode($result));
		//echo '<pre>';print_r(json_decode($result));	
	}	
	
	function friend_request()
	{	
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["member_id"] = '2';
		$formvars["from_member_id"] = '5';
		$formvars["reject"] = '1';
		
		$formvars["token"] = '9bc233dca9f04324fe5a6be02e5485f2';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '2ab0265b8daa0e926c5f39b6efb78a21';
		$formvars["debug"] = '1';
		$url = 'http://localhost/zhanyou';
		//$url = 'http://z.no4e.com';
		$action = $url.'/index.php/api/client/friend_request';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;
		echo '<pre>';var_dump(json_decode($result));
		//echo '<pre>';print_r(json_decode($result));	
	}
	
	
	function get_message()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["member_id"] = '2';
		$formvars["last_query"] = '0';
		$formvars["count_per_page"] = '50';
		
		$formvars["token"] = '85894d686032b129bcf12dc5fe3bcc54';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = 'ac:f7:f3:a7:8a:2a';
		
		$formvars["debug"] = '0';
		//$url = 'http://localhost/zhanyou';
		$url = 'http://z.no4e.com';
		$action = $url.'/index.php/api/client/get_message';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;
		//echo '<pre>';var_dump(json_decode($result));
		echo '<pre>';print_r(json_decode($result));	
	}	
	
	function get_im_message()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["member_id"] = '3';
		$formvars["last_query"] = '0';
		$formvars["count_per_page"] = '200';
		$formvars["token"] = '509c7a536d40479df6f63517a83524fa';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = 'a09a3a3a1d08e770b89f046be6670139';
		$formvars["debug"] = '0';
		$url = 'http://localhost/zhanyou';
		//$url = 'http://z.no4e.com';
		$action = $url.'/index.php/api/client/get_im_message';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;
		//echo '<pre>';var_dump(json_decode($result));
		echo '<pre>';print_r(json_decode($result));	
	}	
	
	function get_list_message()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["member_id"] = '2';
		$formvars["last_query"] = '0';
		$formvars["count_per_page"] = '200';
		$formvars["token"] = '509c7a536d40479df6f63517a83524fa';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = 'a09a3a3a1d08e770b89f046be6670139';
		$formvars["debug"] = '1';
		$url = 'http://localhost/zhanyou';
		//$url = 'http://z.no4e.com';
		$action = $url.'/index.php/api/client/get_list_message';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;
		//echo '<pre>';var_dump(json_decode($result));
		echo '<pre>';print_r(json_decode($result));	
	}			
	
	
	function set_message_read()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["member_id"] = '2';
		$formvars["message_ids"] = '';
		//$formvars["message_ids"] = '1';
		$formvars["token"] = '9bc233dca9f04324fe5a6be02e5485f2';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '2ab0265b8daa0e926c5f39b6efb78a21';
		$formvars["debug"] = '0';
		$url = 'http://localhost/zhanyou';
		//$url = 'http://z.no4e.com';
		$action = $url.'/index.php/api/client/set_message_read';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;
		//echo '<pre>';var_dump(json_decode($result));
		echo '<pre>';print_r(json_decode($result));	
	}		
	function send_message()
	{	
		//die('lojhh');
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["member_id"] = '601';
		$formvars["from_member_id"] = '701';
		$formvars["message"] = "xzzzzzzzzzzzx'''''z''''''";
		$formvars["message_type"] = '1';
		
		
		$formvars["token"] = '9bc233dca9f04324fe5a6be02e5485f2';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '2ab0265b8daa0e926c5f39b6efb78a21';
		$formvars["debug"] = '0';
		$url = 'http://localhost/zhanyou';
		//$url = 'http://z.no4e.com';
		$action = $url.'/index.php/api/client/send_message';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;
		//echo '<pre>';var_dump(json_decode($result));
		echo '<pre>';print_r(json_decode($result));	
	}
	
	
	function add_new_product()
	{	
		//$member_id,$product_id,$product_name,$product_detail,$tags
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["member_id"] = '2';
		$formvars["product_id"] = '56';
		$formvars["product_name"] = 'assaaaaaaaaaaa';
		$formvars["product_detail"] = 'ggghhkhkbbbbbbbbbbbbb';
		$formvars["tags"] = json_encode(array('1','2','3'));
		
		
		$formvars["token"] = '9bc233dca9f04324fe5a6be02e5485f2';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '2ab0265b8daa0e926c5f39b6efb78a21';
		$formvars["debug"] = '1';
		$url = 'http://localhost/zhanyou';
		//$url = 'http://z.no4e.com';
		$action = $url.'/index.php/api/client/add_new_product';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;
		//echo '<pre>';var_dump(json_decode($result));
		echo '<pre>';print_r(json_decode($result));	
	}	
	
	function update_contact()
	{	
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["member_id"] = '2';
		$formvars["u_name"] = '5u_name6';
		$formvars["product_name"] = 'assaaaaaaaaaaa';
		$formvars["product_detail"] = 'ggghhkhkbbbbbbbbbbbbb';
		$formvars["tags"] = '["1","2","3"]';
		
		
		$formvars["token"] = '9bc233dca9f04324fe5a6be02e5485f2';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '2ab0265b8daa0e926c5f39b6efb78a21';
		$formvars["debug"] = '1';
		$url = 'http://localhost/zhanyou';
		//$url = 'http://z.no4e.com';
		$action = $url.'/index.php/api/client/update_contact';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;
		//echo '<pre>';var_dump(json_decode($result));
		echo '<pre>';print_r(json_decode($result));	
	}
	
	
	function import_pro_from_no4e_test()
	{	
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["company_user"] = 'cbd_by0006';
	
		
		$formvars["token"] = '9bc233dca9f04324fe5a6be02e5485f2';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '2ab0265b8daa0e926c5f39b6efb78a21';
		$formvars["debug"] = '0';
		//$url = 'http://localhost/suixing';
		$url = 'http://c.no4e.com';
		$action = $url.'/index.php/api/io/import_pro_from_no4e';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		//echo $result;
		//echo '<pre>';var_dump(json_decode($result));
		$temp = json_decode($result);
		print_r( $temp[0]->info->id);die();
		echo '<pre>';print_r(json_decode($result));	
		die();
		$a = json_decode($result);
		foreach($a as $line){
			print_r($line->info->id);
			echo '<hr>';	
		}
		
	}	
	
	function import_pro_from_no4e()
	{	
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["company_user"] = 'cbd_by0006';
		$formvars["account_id"] = '1';
		
		$formvars["token"] = '9bc233dca9f04324fe5a6be02e5485f2';
		$formvars["client_key"] = '8kkll1Vx';
		$formvars["device_id"] = '2ab0265b8daa0e926c5f39b6efb78a21';
		$formvars["debug"] = '0';
		$url = 'http://localhost/zhanyou';
		//$url = 'http://c.no4e.com';
		$action = $url.'/index.php/api/client/import_pro_from_no4e';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;
		//echo '<pre>';var_dump(json_decode($result));
		echo '<pre>';print_r(json_decode($result));	
	}	
	
	function news_list_test()
	{	
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["type_id"] = '2';
		
		//$url = 'http://localhost/zhanyou';
		$url = 'http://z.no4e.com';
		$action = $url.'/index.php/api/client/news_list';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;
		//echo '<pre>';var_dump(json_decode($result));
		echo '<pre>';print_r(json_decode($result));	
	}	
	
	
	
	function select_base_from_no4e()
	{	
		$this->load->library('Snoopy');	
		$snoopy = new Snoopy();	
		$formvars["from"] = '10';
		$formvars["page"] = '0';
		$formvars["per_num"] = '20';
		$url = 'http://localhost/zhanyou';
		//$url = 'http://c.no4e.com';
		$action = $url.'/index.php/api/client/select_base_from_no4e';//表单提交地址
		
		$snoopy->submit($action,$formvars);//$formvars为提交的数组
		$result = $snoopy->results;  //获取表单提交后的 返回的结果
		
		echo $result;
		//echo '<pre>';var_dump(json_decode($result));
		echo '<pre>';print_r(json_decode($result));	
	}			
	
	
		
}